<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        /*
        正则表达式：有叫规则表达式，规则字符串中字符出现规律的表达式
        语法
        /pattern/attributes
        构造函数的方式了解
        */
        var a="hello world";
        var reg=/l/g;
        var b=a.replace(reg,"*");
        console.log(b);
      
    </script>
</body>
</html>